package lambda;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;

public class lambdaTest {

    public static void main(String[] args) {

        Supplier<Apple> c1 = Apple::new;

        Function<Integer, Apple> c2 = Apple::new;

        Function<Integer, Apple> c3 = (Integer a) -> new Apple(a);

        Function<Integer, Apple> c4 = new Function<Integer, Apple>() {
            @Override
            public Apple apply(Integer integer) {
                return new Apple(integer);
            }
        };

        c4.apply(5);


        Apple apple = c2.apply(1);

        Integer aa = 9;
        Optional<Integer> aaI = Optional.of(aa);

        aaI.map(a -> Integer.toString(a));

    }


}
